<?php
class regionModel extends baseModel{
    protected $table = 'user_region';

	public function __construct()
    {
        parent::__construct();
    }

    public function region_list($pid=1,$type=1)
    {
    	return $this->select('pid='.intval($pid).' AND type='.intval($type));
    }

    //获取名称
    public function get_name($id)
    {
    	if(empty($id)){
    		return;
    	}
    	$info=$this->find('id='.intval($id));
    	return $info['name'];
    }

}